Package i2p :: Module samclasses :: Class StreamSession
[show private | hide private]
[frames | no frames]

Class StreamSession

BaseSession --+
              |
             StreamSession


Stream session. All methods are blocking and threadsafe.
Method Summary
  __init__(self, name, addr, **kwargs)
  __len__(self)
Unconnected session; has no read data available.
  _on_STREAM_CLOSED(self, **kwargs)
Got STREAM CLOSED command.
  _on_STREAM_CONNECTED(self, **kwargs)
Got STREAM CONNECTED command.
  _on_STREAM_RECEIVED(self, **kwargs)
Got STREAM RECEIVED command.
  _on_STREAM_STATUS(self, **kwargs)
Internal command, got STREAM STATUS.
  _send_stream(self, id, data)
Internal command, send data to stream id.
  accept(self, timeout)
Wait for incoming connection, and return a Stream object for it.
  connect(self, dest, timeout)
Create a stream connected to remote destination 'dest'.
  listen(self, backlog)
Set maximum number of queued connections.
    Inherited from BaseSession
  _encode_kwargs(self, **kwargs)
Internal command, encode extra kwargs for passing to SESSION CREATE.
  _hello(self)
Internal command, handshake with SAM terminal.
  _namelookup(self, name)
Internal command, does a NAMING LOOKUP query.
  _on_HELLO_REPLY(self, **kwargs)
Internal command, got HELLO REPLY.
  _on_NAMING_REPLY(self, **kwargs)
Internal command, got NAMING REPLY.
  _on_SESSION_STATUS(self, **kwargs)
Internal command, got SESSION STATUS.
  _set_properties(self)
Internal command, call at end of __init__ to set up properties.
  close(self)
Close the session.

Method Details

__len__(self)
(Length operator)

Unconnected session; has no read data available.

_on_STREAM_CLOSED(self, **kwargs)

Got STREAM CLOSED command. Call idmap[id].on_close(e) and delete idmap[id].

_on_STREAM_CONNECTED(self, **kwargs)

Got STREAM CONNECTED command. This is what accept() commands wait for.

_on_STREAM_RECEIVED(self, **kwargs)

Got STREAM RECEIVED command. Dispatch to idmap[id].on_receive(s).

_on_STREAM_STATUS(self, **kwargs)

Internal command, got STREAM STATUS. Unblocks connect.

_send_stream(self, id, data)

Internal command, send data to stream id. Use Stream.send in your code.

accept(self, timeout=None)

Wait for incoming connection, and return a Stream object for it.

connect(self, dest, timeout=None)

Create a stream connected to remote destination 'dest'. The id is random. If the timeout is exceeded, do NOT raise an error; rather, return a Stream object with .didconnect set to False.

listen(self, backlog)

Set maximum number of queued connections.

Generated by Epydoc 2.1 on Mon Aug 02 01:07:41 2004 http://epydoc.sf.net